package com.idealighter.game.service.admin.convert;

import com.idealighter.game.dao.manage.po.Admin;
import com.idealighter.game.dao.manage.po.Permission;
import com.idealighter.game.dao.logger.po.Loginlog;
import com.idealighter.game.service.admin.bo.AdminBo;
import com.idealighter.game.service.admin.bo.IPListBo;
import com.idealighter.game.service.admin.bo.PermissionBo;

import java.util.List;

import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueMappingStrategy;

@Mapper
public interface AdminBoConvert {
  AdminBo toAdminBo(Admin admin);

  List<AdminBo> toAdminBos(List<Admin> admins);

  Admin toAdmin(AdminBo adminBo);

  PermissionBo toPermissionBo(Permission permission);

  /**
   * zzk修改 测试
   *
   * @param bo 玩家.
   * @return 类别.
   */
  default String toST() {
    return "未知";
  }
  @Mapping(target = "ipsite", expression = "java(toST())")
  IPListBo toIPLists(Loginlog goldLogs);

  @IterableMapping(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT)
  List<IPListBo> toIPLists(List<Loginlog> goldLogs);

  List<PermissionBo> toPermissionBos(List<Permission> permissions);
}
